package jmine.tec.web.wicket.component.menu;

import java.io.Serializable;

import org.apache.wicket.markup.html.link.AbstractLink;

/**
 * @author katsuo.ogawa
 * @date Jul 5, 2011
 */
public abstract class MenuLink implements Serializable {

    private final String caption;

    private final StringBuilder path;

    /**
     * Construtor
     * 
     * @param caption Descrição do link.
     */
    public MenuLink(String caption) {
        this.caption = caption;
        this.path = new StringBuilder(caption);
    }

    /**
     * @return the caption
     */
    protected String getCaption() {
        return this.caption;
    }

    /**
     * @param parentPath Parent Path.
     */
    public void setPath(String parentPath) {
        this.path.insert(0, parentPath + MenuPanel.SEPARATOR);
    }

    /**
     * @return the path
     */
    public String getPath() {
        return this.path.toString();
    }

    /**
     * @return the link
     */
    public abstract AbstractLink getLink();

}
